<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增规则要素组')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-group-add">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">归属机构：</label>
            <div class="col-sm-8">
                <select name="deptId" class="form-control" th:with="type=${@dept.selectDeptListByType('2')}" required>
                    <option th:each="dept : ${type}" th:text="${dept.deptName}" th:value="${dept.deptId}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">组合编码：</label>
            <div class="col-sm-8">
                <input name="groupCode" class="form-control" type="text" required placeholder="同一机构下组合编码不可重复"
                       maxlength="20">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">名称：</label>
            <div class="col-sm-8">
                <input name="groupName" class="form-control" type="text" required maxlength="30">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">计算公式：</label>
            <div class="col-sm-8">
                <textarea name="ruleFormulas" class="form-control" required style="height: 200px;"
                          maxlength="500"></textarea>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 参照百度QLExpress规则引擎使用介绍 </span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <textarea name="remark" class="form-control" type="text" maxlength="200"> </textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "rule/group"
    $("#form-group-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-group-add').serialize());
        }
    }
</script>
</body>
</html>